/***************************************************************************
 创建者: 华磊
 开始时间: 2018.8.14
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2017.5.8 类的具体实现代码编写

 ***************************************************************************/
#include "ioinstruction.h"

IoInstruction::IoInstruction()
{
}


QDataStream& operator <<(QDataStream &out,IoInstruction &myVector)
{
    out << (quint32)myVector.type << (quint32)myVector.front_addtype<<
           (quint32)myVector.back_addtype<<myVector.front_val<<
           myVector.back_val<<myVector.width;

    return out;
}

QDataStream& operator >>(QDataStream &in,IoInstruction &myVector)
{
    quint32 type,frontAddType,backAddType;
    in >> type >> frontAddType >> backAddType >> myVector.front_val>>
          myVector.back_val>>myVector.width;

    myVector.type = (IO_INS_TYPE)type;
    myVector.front_addtype = (ADDRESSING_TYPE)frontAddType;
    myVector.back_addtype = (ADDRESSING_TYPE)backAddType;

    return in;
}
